<div *ngIf="!result.show" class="identity-box">
  <h3 class="text-center" style="font-size: 20px; margin-bottom: 20px;">重置登录密码</h3>
  <form nz-form (ngSubmit)="submitForm()" role="form" #form="ngForm">
    <nz-form-item>
      <nz-form-control>
        <nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-lock">
          <input nz-input type="password" [(ngModel)]="dto.NewPassword" name="password" placeholder="新密码" required [minlength]="[6]"
            #password="ngModel">
        </nz-input-group>
        <nz-form-explain *ngIf="(password.dirty || password.touched) && password.errors?.required">请输入密码</nz-form-explain>
        <nz-form-explain *ngIf="(password.dirty || password.touched) && password.errors?.rangeLength">密码长度不足6位</nz-form-explain>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control>
        <nz-input-group nzSize="large" nzPrefixIcon="anticon anticon-lock">
          <input nz-input type="password" [(ngModel)]="dto.ConfirmPassword" name="confirmPassword" placeholder="确认密码" required [equalTo]="password"
            #confirmPassword="ngModel">
        </nz-input-group>
        <nz-form-explain *ngIf="(confirmPassword.dirty || confirmPassword.touched) && confirmPassword.errors?.required">确认密码不能为空</nz-form-explain>
        <nz-form-explain *ngIf="(confirmPassword.dirty || confirmPassword.touched) && confirmPassword.errors?.equalTo">两次输入密码不一致</nz-form-explain>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-row>
        <nz-col nzOffset="16">
          <button nz-button nzSize="large" nzType="primary" type="submit" [disabled]="!(form.form.valid && canSubmit && auth.ResetPassword)">提交</button>
          <a style="line-height: 45px;margin-left: 10px;" [routerLink]="[ '/home' ]">返回首页</a>
        </nz-col>
      </nz-row>
    </nz-form-item>
  </form>
</div>
<result *ngIf="result.show" type="{{result.type}}" [title]="result.title" description="{{result.description}}">
  <button nz-button [nzType]="'primary'" (click)="router.navigate(['identity/login'])" *ngIf="result.type=='success'">登录</button>
  <button nz-button [nzType]="'primary'" (click)="result.show=false" *ngIf="result.type!='success'">返回</button>
  <button nz-button (click)="router.navigate(['home'])">返回首页</button>
</result>